package cn.iocoder.yudao.module.system.service.order;

import cn.iocoder.yudao.module.system.service.strategy.OrderFactory;
import cn.iocoder.yudao.module.system.service.strategy.OrderStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService {


    private final OrderFactory orderFactory;

    public OrderService(OrderFactory orderFactory) {
        this.orderFactory = orderFactory;
    }


    /**
     * 根据类型执行对应的策略逻辑
     * @return 结果
     */
    public String process(String orderType) {
        orderFactory.getStrategy(orderType).processOrder();
        return "处理成功";
    }

}
